You are here: Symbol Reference > Dew Namespace > Dew.Signal Namespace > Dew.Signal.Units Namespace > Classes > SignalUtils Class > SignalUtils Methods > RemoveDC Method > SignalUtils.RemoveDC Method ([In] TVec, int, int)
Dew Signal for .NET
ContentsIndexHome
Example

The sampling frequency is 256 Hz. A tone has a frequency 6Hz, amplitude 1 and DC offset is 4.

using Dew.Math; using Dew.Math.Editors; using Dew.Math.Units; using Dew.Signal; using Dew.Signal.Units; using Dew.Math.Tee; using Dew.Signal.Tee; private void button1_Click(object sender, EventArgs e) { Vector b = new Vector(0); Vector c = new Vector(0); Vector Response1 = new Vector(0); Vector Response2 = new Vector(0); SignalUtils.Tone(b, 256, 6.0 / 256, 0, 1, false); b = b + 4; c.Copy(b); SignalUtils.RemoveDC(b); MtxVecTee.DrawIt(new TVec[2] {c,b}, new string[2] {"Original signal","Signal without DC"},"Time signals", false); SignalUtils.FrequencyResponse(c, null, Response1, 1, true, TSignalWindowType.wtRectangular, 0); SignalUtils.FrequencyResponse(b, null, Response2, 1, true, TSignalWindowType.wtRectangular, 0); MtxVecTee.DrawIt(new TVec[2] {Response1,Response2}, new string[2] {"Spectrum: original signal","Spectrum: signal without DC"}, "Frequency spectrum", false);
Copyright (c) 1999-2024 by Dew Research. All rights reserved.